Global Index
HTML5 JS API Index > Canvas Tutorials & Specs

TextMetrics

Properties
double
actualBoundingBoxAscent
The distance from the horizontal line indicated by the textBaseline attribute to the top of the bounding rectangle of the given text, in CSS pixels; positive numbers indicating a distance going up from the given baseline.
double
actualBoundingBoxDescent
The distance from the horizontal line indicated by the textBaseline attribute to the bottom of the bounding rectangle of the given text, in CSS pixels; positive numbers indicating a distance going down from the given baseline.
double
actualBoundingBoxLeft
The distance parallel to the baseline from the alignment point given by the textAlign attribute to the left side of the bounding rectangle of the given text, in CSS pixels; positive numbers indicating a distance going left from the given alignment point.
double
actualBoundingBoxRight
The distance parallel to the baseline from the alignment point given by the textAlign attribute to the right side of the bounding rectangle of the given text, in CSS pixels; positive numbers indicating a distance going right from the given alignment point.
double
alphabeticBaseline
The distance from the horizontal line indicated by the textBaseline attribute to the alphabetic baseline of the line box, in CSS pixels; positive numbers indicating that the given baseline is below the alphabetic baseline. (Zero if the given baseline is the alphabetic baseline.)
double
emHeightAscent
The distance from the horizontal line indicated by the textBaseline attribute to the highest top of the em squares in the line box, in CSS pixels; positive numbers indicating that the given baseline is below the top of that em square (so this value will usually be positive).
double
emHeightDescent
The distance from the horizontal line indicated by the textBaseline attribute to the lowest bottom of the em squares in the line box, in CSS pixels; positive numbers indicating that the given baseline is below the bottom of that em square (so this value will usually be negative).
double
fontBoundingBoxAscent
The distance from the horizontal line indicated by the textBaseline attribute to the top of the highest bounding rectangle of all the fonts used to render the text, in CSS pixels; positive numbers indicating a distance going up from the given baseline.
double
fontBoundingBoxDescent
The distance from the horizontal line indicated by the textBaseline attribute to the bottom of the lowest bounding rectangle of all the fonts used to render the text, in CSS pixels; positive numbers indicating a distance going down from the given baseline.
double
hangingBaseline
The distance from the horizontal line indicated by the textBaseline attribute to the hanging baseline of the line box, in CSS pixels; positive numbers indicating that the given baseline is below the hanging baseline. (Zero if the given baseline is the hanging baseline.)
double
ideographicBaseline
The distance from the horizontal line indicated by the textBaseline attribute to the ideographic baseline of the line box, in CSS pixels; positive numbers indicating that the given baseline is below the ideographic baseline. (Zero if the given baseline is the ideographic baseline.)
double
width
The width attribute, on getting, must return the width of the rendering context's scratch bitmap, in CSS pixels. On setting, it must set bitmap dimensions to the new value and the current height of the rendering context's scratch bitmap in CSS pixels, respectively.
Referenced by
CanvasRenderingContext2DmeasureText(...)